import { Column, Entity, PrimaryGeneratedColumn } from "typeorm";

@Entity("school", { schema: "alumni" })
export class School {
  @PrimaryGeneratedColumn({ type: "int", name: "id", unsigned: true })
  id: number;

  @Column("varchar", { name: "name", comment: "学校名字", length: 100 })
  name: string;

  @Column("int", {
    name: "admin_id",
    comment: "管理员id",
    unsigned: true,
    default: () => "'0'",
  })
  adminId: number;

  @Column("varchar", { name: "logo", comment: "学校logo", length: 100 })
  logo: string;

  @Column("varchar", { name: "video", comment: "视频", length: 100 })
  video: string;

  @Column("varchar", { name: "official_website", comment: "官网", length: 100 })
  officialWebsite: string;

  @Column("varchar", { name: "address", length: 100 })
  address: string;

  @Column("varchar", { name: "postal_code", length: 10 })
  postalCode: string;

  @Column("varchar", { name: "tel", length: 20 })
  tel: string;

  @Column("varchar", { name: "email", length: 50 })
  email: string;

  @Column("varchar", { name: "excerpt", comment: "摘录", length: 200 })
  excerpt: string;

  @Column("text", { name: "content", nullable: true, comment: "学校介绍" })
  content: string | null;

  @Column("text", { name: "time_memory", nullable: true, comment: "时光机" })
  timeMemory: string | null;

  @Column("int", {
    name: "sort",
    comment: "排序越大越靠前",
    default: () => "'0'",
  })
  sort: number;

  @Column("boolean", { name: "enable" })
  enable: boolean;

  @Column("int", {
    name: "creator_id",
    comment: "创建人",
    unsigned: true,
    default: () => "'0'",
  })
  creatorId: number;

  @Column("int", { name: "create_time", unsigned: true, default: () => "'0'" })
  createTime: number;

  @Column("int", { name: "update_time", unsigned: true, default: () => "'0'" })
  updateTime: number;
}
